/**
 * 
 */
package com.moji.cyg.web.member;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import com.moji.cyg.biz.user.UserModel;

/**
 * 类UserForm.java的实现描述：TODO 类实现描述
 * 
 * @author shengli.caosl 2012-2-27 下午10:17:02
 */
public class UserForm {
    @Size(max=20,min=6,message="用户名长度必须在6-20个字符间")
    private String    userName;
    
    @Size(max=20,min=6,message="密码长度必须在6-20个字符间")
    private String    password;
    
    @Size(max=20,min=6,message="密码长度必须在6-20个字符间")
    private String    twicePassword;
    
    @Pattern(regexp="([\\w-.]+@[\\w.]+)?",message="请填写正确邮箱")
    @Size(max=64)
    private String    email;
    
    @Size(max=10,message="qq长度必须小于10位")
    
    private String    qq;
    
    @Size(max=16,message="手机号码必须小于16位")
    private String    mobile;
    
    private UserModel user = new UserModel();

    /**
     * @return the userName
     */
    public String getUserName() {
        return userName;
    }

    /**
     * @param userName the userName to set
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the qq
     */
    public String getQq() {
        return qq;
    }

    /**
     * @param qq the qq to set
     */
    public void setQq(String qq) {
        this.qq = qq;
    }

    /**
     * @return the mobile
     */
    public String getMobile() {
        return mobile;
    }

    /**
     * @param mobile the mobile to set
     */
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public UserModel getUserModel() {
        user.setUserName(userName);
        user.setPassword(password);
        user.setQq(qq);
        user.setMobile(mobile);
        user.setEmail(email);
        return user;
    }

    /**
     * @return the twicePassword
     */
    public String getTwicePassword() {
        return twicePassword;
    }

    /**
     * @param twicePassword the twicePassword to set
     */
    public void setTwicePassword(String twicePassword) {
        this.twicePassword = twicePassword;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "UserForm [userName=" + userName + ", password=" + password + ", twicePassword=" + twicePassword
               + ", email=" + email + ", qq=" + qq + ", mobile=" + mobile + ", user=" + user + "]";
    }

}
